//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension Athena {
    // MARK: Enums

    public enum ColumnNullable: String, CustomStringConvertible, Codable {
        case notNull = "NOT_NULL"
        case nullable = "NULLABLE"
        case unknown = "UNKNOWN"
        public var description: String { return self.rawValue }
    }

    public enum DataCatalogType: String, CustomStringConvertible, Codable {
        case glue = "GLUE"
        case hive = "HIVE"
        case lambda = "LAMBDA"
        public var description: String { return self.rawValue }
    }

    public enum EncryptionOption: String, CustomStringConvertible, Codable {
        case cseKms = "CSE_KMS"
        case sseKms = "SSE_KMS"
        case sseS3 = "SSE_S3"
        public var description: String { return self.rawValue }
    }

    public enum QueryExecutionState: String, CustomStringConvertible, Codable {
        case cancelled = "CANCELLED"
        case failed = "FAILED"
        case queued = "QUEUED"
        case running = "RUNNING"
        case succeeded = "SUCCEEDED"
        public var description: String { return self.rawValue }
    }

    public enum StatementType: String, CustomStringConvertible, Codable {
        case ddl = "DDL"
        case dml = "DML"
        case utility = "UTILITY"
        public var description: String { return self.rawValue }
    }

    public enum WorkGroupState: String, CustomStringConvertible, Codable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct BatchGetNamedQueryInput: AWSEncodableShape {
        /// An array of query IDs.
        public let namedQueryIds: [String]

        public init(namedQueryIds: [String]) {
            self.namedQueryIds = namedQueryIds
        }

        public func validate(name: String) throws {
            try self.validate(self.namedQueryIds, name: "namedQueryIds", parent: name, max: 50)
            try self.validate(self.namedQueryIds, name: "namedQueryIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case namedQueryIds = "NamedQueryIds"
        }
    }

    public struct BatchGetNamedQueryOutput: AWSDecodableShape {
        /// Information about the named query IDs submitted.
        public let namedQueries: [NamedQuery]?
        /// Information about provided query IDs.
        public let unprocessedNamedQueryIds: [UnprocessedNamedQueryId]?

        public init(namedQueries: [NamedQuery]? = nil, unprocessedNamedQueryIds: [UnprocessedNamedQueryId]? = nil) {
            self.namedQueries = namedQueries
            self.unprocessedNamedQueryIds = unprocessedNamedQueryIds
        }

        private enum CodingKeys: String, CodingKey {
            case namedQueries = "NamedQueries"
            case unprocessedNamedQueryIds = "UnprocessedNamedQueryIds"
        }
    }

    public struct BatchGetQueryExecutionInput: AWSEncodableShape {
        /// An array of query execution IDs.
        public let queryExecutionIds: [String]

        public init(queryExecutionIds: [String]) {
            self.queryExecutionIds = queryExecutionIds
        }

        public func validate(name: String) throws {
            try self.validate(self.queryExecutionIds, name: "queryExecutionIds", parent: name, max: 50)
            try self.validate(self.queryExecutionIds, name: "queryExecutionIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case queryExecutionIds = "QueryExecutionIds"
        }
    }

    public struct BatchGetQueryExecutionOutput: AWSDecodableShape {
        /// Information about a query execution.
        public let queryExecutions: [QueryExecution]?
        /// Information about the query executions that failed to run.
        public let unprocessedQueryExecutionIds: [UnprocessedQueryExecutionId]?

        public init(queryExecutions: [QueryExecution]? = nil, unprocessedQueryExecutionIds: [UnprocessedQueryExecutionId]? = nil) {
            self.queryExecutions = queryExecutions
            self.unprocessedQueryExecutionIds = unprocessedQueryExecutionIds
        }

        private enum CodingKeys: String, CodingKey {
            case queryExecutions = "QueryExecutions"
            case unprocessedQueryExecutionIds = "UnprocessedQueryExecutionIds"
        }
    }

    public struct Column: AWSDecodableShape {
        /// Optional information about the column.
        public let comment: String?
        /// The name of the column.
        public let name: String
        /// The data type of the column.
        public let type: String?

        public init(comment: String? = nil, name: String, type: String? = nil) {
            self.comment = comment
            self.name = name
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case comment = "Comment"
            case name = "Name"
            case type = "Type"
        }
    }

    public struct ColumnInfo: AWSDecodableShape {
        /// Indicates whether values in the column are case-sensitive.
        public let caseSensitive: Bool?
        /// The catalog to which the query results belong.
        public let catalogName: String?
        /// A column label.
        public let label: String?
        /// The name of the column.
        public let name: String
        /// Indicates the column's nullable status.
        public let nullable: ColumnNullable?
        /// For DECIMAL data types, specifies the total number of digits, up to 38. For performance reasons, we recommend up to 18 digits.
        public let precision: Int?
        /// For DECIMAL data types, specifies the total number of digits in the fractional part of the value. Defaults to 0.
        public let scale: Int?
        /// The schema name (database name) to which the query results belong.
        public let schemaName: String?
        /// The table name for the query results.
        public let tableName: String?
        /// The data type of the column.
        public let type: String

        public init(caseSensitive: Bool? = nil, catalogName: String? = nil, label: String? = nil, name: String, nullable: ColumnNullable? = nil, precision: Int? = nil, scale: Int? = nil, schemaName: String? = nil, tableName: String? = nil, type: String) {
            self.caseSensitive = caseSensitive
            self.catalogName = catalogName
            self.label = label
            self.name = name
            self.nullable = nullable
            self.precision = precision
            self.scale = scale
            self.schemaName = schemaName
            self.tableName = tableName
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case caseSensitive = "CaseSensitive"
            case catalogName = "CatalogName"
            case label = "Label"
            case name = "Name"
            case nullable = "Nullable"
            case precision = "Precision"
            case scale = "Scale"
            case schemaName = "SchemaName"
            case tableName = "TableName"
            case type = "Type"
        }
    }

    public struct CreateDataCatalogInput: AWSEncodableShape {
        /// A description of the data catalog to be created.
        public let description: String?
        /// The name of the data catalog to create. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.
        public let name: String
        /// Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type.    For the HIVE data catalog type, use the following syntax. The metadata-function parameter is required. The sdk-version parameter is optional and defaults to the currently supported version.  metadata-function=lambda_arn, sdk-version=version_number     For the LAMBDA data catalog type, use one of the following sets of required parameters, but not both.   If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.  metadata-function=lambda_arn, record-function=lambda_arn      If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.  function=lambda_arn
        public let parameters: [String: String]?
        /// A list of comma separated tags to add to the data catalog that is created.
        public let tags: [Tag]?
        /// The type of data catalog to create: LAMBDA for a federated catalog or HIVE for an external hive metastore.  Do not use the GLUE type. This refers to the AwsDataCatalog that already exists in your account, of which you can have only one. Specifying the GLUE type will result in an INVALID_INPUT error.
        public let type: DataCatalogType

        public init(description: String? = nil, name: String, parameters: [String: String]? = nil, tags: [Tag]? = nil, type: DataCatalogType) {
            self.description = description
            self.name = name
            self.parameters = parameters
            self.tags = tags
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.parameters?.forEach {
                try validate($0.key, name: "parameters.key", parent: name, max: 255)
                try validate($0.key, name: "parameters.key", parent: name, min: 1)
                try validate($0.key, name: "parameters.key", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
                try validate($0.value, name: "parameters[\"\($0.key)\"]", parent: name, max: 51200)
            }
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case name = "Name"
            case parameters = "Parameters"
            case tags = "Tags"
            case type = "Type"
        }
    }

    public struct CreateDataCatalogOutput: AWSDecodableShape {
        public init() {}
    }

    public struct CreateNamedQueryInput: AWSEncodableShape {
        /// A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another CreateNamedQuery request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the QueryString, an error is returned.  This token is listed as not required because AWS SDKs (for example the AWS SDK for Java) auto-generate the token for users. If you are not using the AWS SDK or the AWS CLI, you must provide this token or the action will fail.
        public let clientRequestToken: String?
        /// The database to which the query belongs.
        public let database: String
        /// The query description.
        public let description: String?
        /// The query name.
        public let name: String
        /// The contents of the query with all query statements.
        public let queryString: String
        /// The name of the workgroup in which the named query is being created.
        public let workGroup: String?

        public init(clientRequestToken: String? = CreateNamedQueryInput.idempotencyToken(), database: String, description: String? = nil, name: String, queryString: String, workGroup: String? = nil) {
            self.clientRequestToken = clientRequestToken
            self.database = database
            self.description = description
            self.name = name
            self.queryString = queryString
            self.workGroup = workGroup
        }

        public func validate(name: String) throws {
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 128)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 32)
            try self.validate(self.database, name: "database", parent: name, max: 255)
            try self.validate(self.database, name: "database", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.queryString, name: "queryString", parent: name, max: 262_144)
            try self.validate(self.queryString, name: "queryString", parent: name, min: 1)
            try self.validate(self.workGroup, name: "workGroup", parent: name, pattern: "[a-zA-Z0-9._-]{1,128}")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case database = "Database"
            case description = "Description"
            case name = "Name"
            case queryString = "QueryString"
            case workGroup = "WorkGroup"
        }
    }

    public struct CreateNamedQueryOutput: AWSDecodableShape {
        /// The unique ID of the query.
        public let namedQueryId: String?

        public init(namedQueryId: String? = nil) {
            self.namedQueryId = namedQueryId
        }

        private enum CodingKeys: String, CodingKey {
            case namedQueryId = "NamedQueryId"
        }
    }

    public struct CreateWorkGroupInput: AWSEncodableShape {
        /// The configuration for the workgroup, which includes the location in Amazon S3 where query results are stored, the encryption configuration, if any, used for encrypting query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, the limit for the amount of bytes scanned (cutoff) per query, if it is specified, and whether workgroup's settings (specified with EnforceWorkGroupConfiguration) in the WorkGroupConfiguration override client-side settings. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
        public let configuration: WorkGroupConfiguration?
        /// The workgroup description.
        public let description: String?
        /// The workgroup name.
        public let name: String
        /// A list of comma separated tags to add to the workgroup that is created.
        public let tags: [Tag]?

        public init(configuration: WorkGroupConfiguration? = nil, description: String? = nil, name: String, tags: [Tag]? = nil) {
            self.configuration = configuration
            self.description = description
            self.name = name
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.configuration?.validate(name: "\(name).configuration")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9._-]{1,128}")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case configuration = "Configuration"
            case description = "Description"
            case name = "Name"
            case tags = "Tags"
        }
    }

    public struct CreateWorkGroupOutput: AWSDecodableShape {
        public init() {}
    }

    public struct DataCatalog: AWSDecodableShape {
        /// An optional description of the data catalog.
        public let description: String?
        /// The name of the data catalog. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.
        public let name: String
        /// Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on the catalog type.    For the HIVE data catalog type, use the following syntax. The metadata-function parameter is required. The sdk-version parameter is optional and defaults to the currently supported version.  metadata-function=lambda_arn, sdk-version=version_number     For the LAMBDA data catalog type, use one of the following sets of required parameters, but not both.   If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.  metadata-function=lambda_arn, record-function=lambda_arn      If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.  function=lambda_arn
        public let parameters: [String: String]?
        /// The type of data catalog: LAMBDA for a federated catalog or HIVE for an external hive metastore. GLUE refers to the AwsDataCatalog that already exists in your account, of which you can have only one.
        public let type: DataCatalogType

        public init(description: String? = nil, name: String, parameters: [String: String]? = nil, type: DataCatalogType) {
            self.description = description
            self.name = name
            self.parameters = parameters
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case name = "Name"
            case parameters = "Parameters"
            case type = "Type"
        }
    }

    public struct DataCatalogSummary: AWSDecodableShape {
        /// The name of the data catalog.
        public let catalogName: String?
        /// The data catalog type.
        public let type: DataCatalogType?

        public init(catalogName: String? = nil, type: DataCatalogType? = nil) {
            self.catalogName = catalogName
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case catalogName = "CatalogName"
            case type = "Type"
        }
    }

    public struct Database: AWSDecodableShape {
        /// An optional description of the database.
        public let description: String?
        /// The name of the database.
        public let name: String
        /// A set of custom key/value pairs.
        public let parameters: [String: String]?

        public init(description: String? = nil, name: String, parameters: [String: String]? = nil) {
            self.description = description
            self.name = name
            self.parameters = parameters
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case name = "Name"
            case parameters = "Parameters"
        }
    }

    public struct Datum: AWSDecodableShape {
        /// The value of the datum.
        public let varCharValue: String?

        public init(varCharValue: String? = nil) {
            self.varCharValue = varCharValue
        }

        private enum CodingKeys: String, CodingKey {
            case varCharValue = "VarCharValue"
        }
    }

    public struct DeleteDataCatalogInput: AWSEncodableShape {
        /// The name of the data catalog to delete.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeleteDataCatalogOutput: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteNamedQueryInput: AWSEncodableShape {
        /// The unique ID of the query to delete.
        public let namedQueryId: String

        public init(namedQueryId: String = DeleteNamedQueryInput.idempotencyToken()) {
            self.namedQueryId = namedQueryId
        }

        private enum CodingKeys: String, CodingKey {
            case namedQueryId = "NamedQueryId"
        }
    }

    public struct DeleteNamedQueryOutput: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteWorkGroupInput: AWSEncodableShape {
        /// The option to delete the workgroup and its contents even if the workgroup contains any named queries or query executions.
        public let recursiveDeleteOption: Bool?
        /// The unique name of the workgroup to delete.
        public let workGroup: String

        public init(recursiveDeleteOption: Bool? = nil, workGroup: String) {
            self.recursiveDeleteOption = recursiveDeleteOption
            self.workGroup = workGroup
        }

        public func validate(name: String) throws {
            try self.validate(self.workGroup, name: "workGroup", parent: name, pattern: "[a-zA-Z0-9._-]{1,128}")
        }

        private enum CodingKeys: String, CodingKey {
            case recursiveDeleteOption = "RecursiveDeleteOption"
            case workGroup = "WorkGroup"
        }
    }

    public struct DeleteWorkGroupOutput: AWSDecodableShape {
        public init() {}
    }

    public struct EncryptionConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys (SSE-S3), server-side encryption with KMS-managed keys (SSE-KMS), or client-side encryption with KMS-managed keys (CSE-KMS) is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup.
        public let encryptionOption: EncryptionOption
        /// For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.
        public let kmsKey: String?

        public init(encryptionOption: EncryptionOption, kmsKey: String? = nil) {
            self.encryptionOption = encryptionOption
            self.kmsKey = kmsKey
        }

        private enum CodingKeys: String, CodingKey {
            case encryptionOption = "EncryptionOption"
            case kmsKey = "KmsKey"
        }
    }

    public struct EngineVersion: AWSEncodableShape & AWSDecodableShape {
        /// Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup operation, the EffectiveEngineVersion field is ignored.
        public let effectiveEngineVersion: String?
        /// The engine version requested by the user. Possible values are determined by the output of ListEngineVersions, including Auto. The default is Auto.
        public let selectedEngineVersion: String?

        public init(effectiveEngineVersion: String? = nil, selectedEngineVersion: String? = nil) {
            self.effectiveEngineVersion = effectiveEngineVersion
            self.selectedEngineVersion = selectedEngineVersion
        }

        public func validate(name: String) throws {
            try self.validate(self.effectiveEngineVersion, name: "effectiveEngineVersion", parent: name, max: 128)
            try self.validate(self.effectiveEngineVersion, name: "effectiveEngineVersion", parent: name, min: 1)
            try self.validate(self.selectedEngineVersion, name: "selectedEngineVersion", parent: name, max: 128)
            try self.validate(self.selectedEngineVersion, name: "selectedEngineVersion", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case effectiveEngineVersion = "EffectiveEngineVersion"
            case selectedEngineVersion = "SelectedEngineVersion"
        }
    }

    public struct GetDataCatalogInput: AWSEncodableShape {
        /// The name of the data catalog to return.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct GetDataCatalogOutput: AWSDecodableShape {
        /// The data catalog returned.
        public let dataCatalog: DataCatalog?

        public init(dataCatalog: DataCatalog? = nil) {
            self.dataCatalog = dataCatalog
        }

        private enum CodingKeys: String, CodingKey {
            case dataCatalog = "DataCatalog"
        }
    }

    public struct GetDatabaseInput: AWSEncodableShape {
        /// The name of the data catalog that contains the database to return.
        public let catalogName: String
        /// The name of the database to return.
        public let databaseName: String

        public init(catalogName: String, databaseName: String) {
            self.catalogName = catalogName
            self.databaseName = databaseName
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogName, name: "catalogName", parent: name, max: 256)
            try self.validate(self.catalogName, name: "catalogName", parent: name, min: 1)
            try self.validate(self.catalogName, name: "catalogName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.databaseName, name: "databaseName", parent: name, max: 128)
            try self.validate(self.databaseName, name: "databaseName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case catalogName = "CatalogName"
            case databaseName = "DatabaseName"
        }
    }

    public struct GetDatabaseOutput: AWSDecodableShape {
        /// The database returned.
        public let database: Database?

        public init(database: Database? = nil) {
            self.database = database
        }

        private enum CodingKeys: String, CodingKey {
            case database = "Database"
        }
    }

    public struct GetNamedQueryInput: AWSEncodableShape {
        /// The unique ID of the query. Use ListNamedQueries to get query IDs.
        public let namedQueryId: String

        public init(namedQueryId: String) {
            self.namedQueryId = namedQueryId
        }

        private enum CodingKeys: String, CodingKey {
            case namedQueryId = "NamedQueryId"
        }
    }

    public struct GetNamedQueryOutput: AWSDecodableShape {
        /// Information about the query.
        public let namedQuery: NamedQuery?

        public init(namedQuery: NamedQuery? = nil) {
            self.namedQuery = namedQuery
        }

        private enum CodingKeys: String, CodingKey {
            case namedQuery = "NamedQuery"
        }
    }

    public struct GetQueryExecutionInput: AWSEncodableShape {
        /// The unique ID of the query execution.
        public let queryExecutionId: String

        public init(queryExecutionId: String) {
            self.queryExecutionId = queryExecutionId
        }

        private enum CodingKeys: String, CodingKey {
            case queryExecutionId = "QueryExecutionId"
        }
    }

    public struct GetQueryExecutionOutput: AWSDecodableShape {
        /// Information about the query execution.
        public let queryExecution: QueryExecution?

        public init(queryExecution: QueryExecution? = nil) {
            self.queryExecution = queryExecution
        }

        private enum CodingKeys: String, CodingKey {
            case queryExecution = "QueryExecution"
        }
    }

    public struct GetQueryResultsInput: AWSEncodableShape {
        /// The maximum number of results (rows) to return in this request.
        public let maxResults: Int?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?
        /// The unique ID of the query execution.
        public let queryExecutionId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, queryExecutionId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.queryExecutionId = queryExecutionId
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case queryExecutionId = "QueryExecutionId"
        }
    }

    public struct GetQueryResultsOutput: AWSDecodableShape {
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?
        /// The results of the query execution.
        public let resultSet: ResultSet?
        /// The number of rows inserted with a CREATE TABLE AS SELECT statement.
        public let updateCount: Int64?

        public init(nextToken: String? = nil, resultSet: ResultSet? = nil, updateCount: Int64? = nil) {
            self.nextToken = nextToken
            self.resultSet = resultSet
            self.updateCount = updateCount
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case resultSet = "ResultSet"
            case updateCount = "UpdateCount"
        }
    }

    public struct GetTableMetadataInput: AWSEncodableShape {
        /// The name of the data catalog that contains the database and table metadata to return.
        public let catalogName: String
        /// The name of the database that contains the table metadata to return.
        public let databaseName: String
        /// The name of the table for which metadata is returned.
        public let tableName: String

        public init(catalogName: String, databaseName: String, tableName: String) {
            self.catalogName = catalogName
            self.databaseName = databaseName
            self.tableName = tableName
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogName, name: "catalogName", parent: name, max: 256)
            try self.validate(self.catalogName, name: "catalogName", parent: name, min: 1)
            try self.validate(self.catalogName, name: "catalogName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.databaseName, name: "databaseName", parent: name, max: 128)
            try self.validate(self.databaseName, name: "databaseName", parent: name, min: 1)
            try self.validate(self.tableName, name: "tableName", parent: name, max: 128)
            try self.validate(self.tableName, name: "tableName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case catalogName = "CatalogName"
            case databaseName = "DatabaseName"
            case tableName = "TableName"
        }
    }

    public struct GetTableMetadataOutput: AWSDecodableShape {
        /// An object that contains table metadata.
        public let tableMetadata: TableMetadata?

        public init(tableMetadata: TableMetadata? = nil) {
            self.tableMetadata = tableMetadata
        }

        private enum CodingKeys: String, CodingKey {
            case tableMetadata = "TableMetadata"
        }
    }

    public struct GetWorkGroupInput: AWSEncodableShape {
        /// The name of the workgroup.
        public let workGroup: String

        public init(workGroup: String) {
            self.workGroup = workGroup
        }

        public func validate(name: String) throws {
            try self.validate(self.workGroup, name: "workGroup", parent: name, pattern: "[a-zA-Z0-9._-]{1,128}")
        }

        private enum CodingKeys: String, CodingKey {
            case workGroup = "WorkGroup"
        }
    }

    public struct GetWorkGroupOutput: AWSDecodableShape {
        /// Information about the workgroup.
        public let workGroup: WorkGroup?

        public init(workGroup: WorkGroup? = nil) {
            self.workGroup = workGroup
        }

        private enum CodingKeys: String, CodingKey {
            case workGroup = "WorkGroup"
        }
    }

    public struct ListDataCatalogsInput: AWSEncodableShape {
        /// Specifies the maximum number of data catalogs to return.
        public let maxResults: Int?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 2)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListDataCatalogsOutput: AWSDecodableShape {
        /// A summary list of data catalogs.
        public let dataCatalogsSummary: [DataCatalogSummary]?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(dataCatalogsSummary: [DataCatalogSummary]? = nil, nextToken: String? = nil) {
            self.dataCatalogsSummary = dataCatalogsSummary
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case dataCatalogsSummary = "DataCatalogsSummary"
            case nextToken = "NextToken"
        }
    }

    public struct ListDatabasesInput: AWSEncodableShape {
        /// The name of the data catalog that contains the databases to return.
        public let catalogName: String
        /// Specifies the maximum number of results to return.
        public let maxResults: Int?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(catalogName: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.catalogName = catalogName
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogName, name: "catalogName", parent: name, max: 256)
            try self.validate(self.catalogName, name: "catalogName", parent: name, min: 1)
            try self.validate(self.catalogName, name: "catalogName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case catalogName = "CatalogName"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListDatabasesOutput: AWSDecodableShape {
        /// A list of databases from a data catalog.
        public let databaseList: [Database]?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(databaseList: [Database]? = nil, nextToken: String? = nil) {
            self.databaseList = databaseList
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case databaseList = "DatabaseList"
            case nextToken = "NextToken"
        }
    }

    public struct ListEngineVersionsInput: AWSEncodableShape {
        /// The maximum number of engine versions to return in this request.
        public let maxResults: Int?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 10)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListEngineVersionsOutput: AWSDecodableShape {
        /// A list of engine versions that are available to choose from.
        public let engineVersions: [EngineVersion]?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(engineVersions: [EngineVersion]? = nil, nextToken: String? = nil) {
            self.engineVersions = engineVersions
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case engineVersions = "EngineVersions"
            case nextToken = "NextToken"
        }
    }

    public struct ListNamedQueriesInput: AWSEncodableShape {
        /// The maximum number of queries to return in this request.
        public let maxResults: Int?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?
        /// The name of the workgroup from which the named queries are being returned. If a workgroup is not specified, the saved queries for the primary workgroup are returned.
        public let workGroup: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil, workGroup: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.workGroup = workGroup
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.workGroup, name: "workGroup", parent: name, pattern: "[a-zA-Z0-9._-]{1,128}")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case workGroup = "WorkGroup"
        }
    }

    public struct ListNamedQueriesOutput: AWSDecodableShape {
        /// The list of unique query IDs.
        public let namedQueryIds: [String]?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(namedQueryIds: [String]? = nil, nextToken: String? = nil) {
            self.namedQueryIds = namedQueryIds
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case namedQueryIds = "NamedQueryIds"
            case nextToken = "NextToken"
        }
    }

    public struct ListQueryExecutionsInput: AWSEncodableShape {
        /// The maximum number of query executions to return in this request.
        public let maxResults: Int?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?
        /// The name of the workgroup from which queries are being returned. If a workgroup is not specified, a list of available query execution IDs for the queries in the primary workgroup is returned.
        public let workGroup: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil, workGroup: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.workGroup = workGroup
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.workGroup, name: "workGroup", parent: name, pattern: "[a-zA-Z0-9._-]{1,128}")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case workGroup = "WorkGroup"
        }
    }

    public struct ListQueryExecutionsOutput: AWSDecodableShape {
        /// A token to be used by the next request if this request is truncated.
        public let nextToken: String?
        /// The unique IDs of each query execution as an array of strings.
        public let queryExecutionIds: [String]?

        public init(nextToken: String? = nil, queryExecutionIds: [String]? = nil) {
            self.nextToken = nextToken
            self.queryExecutionIds = queryExecutionIds
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case queryExecutionIds = "QueryExecutionIds"
        }
    }

    public struct ListTableMetadataInput: AWSEncodableShape {
        /// The name of the data catalog for which table metadata should be returned.
        public let catalogName: String
        /// The name of the database for which table metadata should be returned.
        public let databaseName: String
        /// A regex filter that pattern-matches table names. If no expression is supplied, metadata for all tables are listed.
        public let expression: String?
        /// Specifies the maximum number of results to return.
        public let maxResults: Int?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(catalogName: String, databaseName: String, expression: String? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.catalogName = catalogName
            self.databaseName = databaseName
            self.expression = expression
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.catalogName, name: "catalogName", parent: name, max: 256)
            try self.validate(self.catalogName, name: "catalogName", parent: name, min: 1)
            try self.validate(self.catalogName, name: "catalogName", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.databaseName, name: "databaseName", parent: name, max: 128)
            try self.validate(self.databaseName, name: "databaseName", parent: name, min: 1)
            try self.validate(self.expression, name: "expression", parent: name, max: 256)
            try self.validate(self.expression, name: "expression", parent: name, min: 0)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case catalogName = "CatalogName"
            case databaseName = "DatabaseName"
            case expression = "Expression"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListTableMetadataOutput: AWSDecodableShape {
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?
        /// A list of table metadata.
        public let tableMetadataList: [TableMetadata]?

        public init(nextToken: String? = nil, tableMetadataList: [TableMetadata]? = nil) {
            self.nextToken = nextToken
            self.tableMetadataList = tableMetadataList
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case tableMetadataList = "TableMetadataList"
        }
    }

    public struct ListTagsForResourceInput: AWSEncodableShape {
        /// The maximum number of results to be returned per request that lists the tags for the resource.
        public let maxResults: Int?
        /// The token for the next set of results, or null if there are no additional results for this request, where the request lists the tags for the resource with the specified ARN.
        public let nextToken: String?
        /// Lists the tags for the resource with the specified ARN.
        public let resourceARN: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, resourceARN: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 75)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceOutput: AWSDecodableShape {
        /// A token to be used by the next request if this request is truncated.
        public let nextToken: String?
        /// The list of tags associated with the specified resource.
        public let tags: [Tag]?

        public init(nextToken: String? = nil, tags: [Tag]? = nil) {
            self.nextToken = nextToken
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case tags = "Tags"
        }
    }

    public struct ListWorkGroupsInput: AWSEncodableShape {
        /// The maximum number of workgroups to return in this request.
        public let maxResults: Int?
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 50)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListWorkGroupsOutput: AWSDecodableShape {
        /// A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.
        public let nextToken: String?
        /// A list of WorkGroupSummary objects that include the names, descriptions, creation times, and states for each workgroup.
        public let workGroups: [WorkGroupSummary]?

        public init(nextToken: String? = nil, workGroups: [WorkGroupSummary]? = nil) {
            self.nextToken = nextToken
            self.workGroups = workGroups
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case workGroups = "WorkGroups"
        }
    }

    public struct NamedQuery: AWSDecodableShape {
        /// The database to which the query belongs.
        public let database: String
        /// The query description.
        public let description: String?
        /// The query name.
        public let name: String
        /// The unique identifier of the query.
        public let namedQueryId: String?
        /// The SQL query statements that comprise the query.
        public let queryString: String
        /// The name of the workgroup that contains the named query.
        public let workGroup: String?

        public init(database: String, description: String? = nil, name: String, namedQueryId: String? = nil, queryString: String, workGroup: String? = nil) {
            self.database = database
            self.description = description
            self.name = name
            self.namedQueryId = namedQueryId
            self.queryString = queryString
            self.workGroup = workGroup
        }

        private enum CodingKeys: String, CodingKey {
            case database = "Database"
            case description = "Description"
            case name = "Name"
            case namedQueryId = "NamedQueryId"
            case queryString = "QueryString"
            case workGroup = "WorkGroup"
        }
    }

    public struct QueryExecution: AWSDecodableShape {
        /// The engine version that executed the query.
        public let engineVersion: EngineVersion?
        /// The SQL query statements which the query execution ran.
        public let query: String?
        /// The database in which the query execution occurred.
        public let queryExecutionContext: QueryExecutionContext?
        /// The unique identifier for each query execution.
        public let queryExecutionId: String?
        /// The location in Amazon S3 where query results were stored and the encryption option, if any, used for query results. These are known as "client-side settings". If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup.
        public let resultConfiguration: ResultConfiguration?
        /// The type of query statement that was run. DDL indicates DDL query statements. DML indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT. UTILITY indicates query statements other than DDL and DML, such as SHOW CREATE TABLE, or DESCRIBE &lt;table&gt;.
        public let statementType: StatementType?
        /// Query execution statistics, such as the amount of data scanned, the amount of time that the query took to process, and the type of statement that was run.
        public let statistics: QueryExecutionStatistics?
        /// The completion date, current state, submission time, and state change reason (if applicable) for the query execution.
        public let status: QueryExecutionStatus?
        /// The name of the workgroup in which the query ran.
        public let workGroup: String?

        public init(engineVersion: EngineVersion? = nil, query: String? = nil, queryExecutionContext: QueryExecutionContext? = nil, queryExecutionId: String? = nil, resultConfiguration: ResultConfiguration? = nil, statementType: StatementType? = nil, statistics: QueryExecutionStatistics? = nil, status: QueryExecutionStatus? = nil, workGroup: String? = nil) {
            self.engineVersion = engineVersion
            self.query = query
            self.queryExecutionContext = queryExecutionContext
            self.queryExecutionId = queryExecutionId
            self.resultConfiguration = resultConfiguration
            self.statementType = statementType
            self.statistics = statistics
            self.status = status
            self.workGroup = workGroup
        }

        private enum CodingKeys: String, CodingKey {
            case engineVersion = "EngineVersion"
            case query = "Query"
            case queryExecutionContext = "QueryExecutionContext"
            case queryExecutionId = "QueryExecutionId"
            case resultConfiguration = "ResultConfiguration"
            case statementType = "StatementType"
            case statistics = "Statistics"
            case status = "Status"
            case workGroup = "WorkGroup"
        }
    }

    public struct QueryExecutionContext: AWSEncodableShape & AWSDecodableShape {
        /// The name of the data catalog used in the query execution.
        public let catalog: String?
        /// The name of the database used in the query execution.
        public let database: String?

        public init(catalog: String? = nil, database: String? = nil) {
            self.catalog = catalog
            self.database = database
        }

        public func validate(name: String) throws {
            try self.validate(self.catalog, name: "catalog", parent: name, max: 256)
            try self.validate(self.catalog, name: "catalog", parent: name, min: 1)
            try self.validate(self.catalog, name: "catalog", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.validate(self.database, name: "database", parent: name, max: 255)
            try self.validate(self.database, name: "database", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case catalog = "Catalog"
            case database = "Database"
        }
    }

    public struct QueryExecutionStatistics: AWSDecodableShape {
        /// The location and file name of a data manifest file. The manifest file is saved to the Athena query results location in Amazon S3. The manifest file tracks files that the query wrote to Amazon S3. If the query fails, the manifest file also tracks files that the query intended to write. The manifest is useful for identifying orphaned files resulting from a failed query. For more information, see Working with Query Results, Output Files, and Query History in the Amazon Athena User Guide.
        public let dataManifestLocation: String?
        /// The number of bytes in the data that was queried.
        public let dataScannedInBytes: Int64?
        /// The number of milliseconds that the query took to execute.
        public let engineExecutionTimeInMillis: Int64?
        /// The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time.
        public let queryPlanningTimeInMillis: Int64?
        /// The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue.
        public let queryQueueTimeInMillis: Int64?
        /// The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query.
        public let serviceProcessingTimeInMillis: Int64?
        /// The number of milliseconds that Athena took to run the query.
        public let totalExecutionTimeInMillis: Int64?

        public init(dataManifestLocation: String? = nil, dataScannedInBytes: Int64? = nil, engineExecutionTimeInMillis: Int64? = nil, queryPlanningTimeInMillis: Int64? = nil, queryQueueTimeInMillis: Int64? = nil, serviceProcessingTimeInMillis: Int64? = nil, totalExecutionTimeInMillis: Int64? = nil) {
            self.dataManifestLocation = dataManifestLocation
            self.dataScannedInBytes = dataScannedInBytes
            self.engineExecutionTimeInMillis = engineExecutionTimeInMillis
            self.queryPlanningTimeInMillis = queryPlanningTimeInMillis
            self.queryQueueTimeInMillis = queryQueueTimeInMillis
            self.serviceProcessingTimeInMillis = serviceProcessingTimeInMillis
            self.totalExecutionTimeInMillis = totalExecutionTimeInMillis
        }

        private enum CodingKeys: String, CodingKey {
            case dataManifestLocation = "DataManifestLocation"
            case dataScannedInBytes = "DataScannedInBytes"
            case engineExecutionTimeInMillis = "EngineExecutionTimeInMillis"
            case queryPlanningTimeInMillis = "QueryPlanningTimeInMillis"
            case queryQueueTimeInMillis = "QueryQueueTimeInMillis"
            case serviceProcessingTimeInMillis = "ServiceProcessingTimeInMillis"
            case totalExecutionTimeInMillis = "TotalExecutionTimeInMillis"
        }
    }

    public struct QueryExecutionStatus: AWSDecodableShape {
        /// The date and time that the query completed.
        public let completionDateTime: Date?
        /// The state of query execution. QUEUED indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. RUNNING indicates that the query is in execution phase. SUCCEEDED indicates that the query completed without errors. FAILED indicates that the query experienced an error and did not complete processing. CANCELLED indicates that a user input interrupted query execution.  Athena automatically retries your queries in cases of certain transient errors. As a result, you may see the query state transition from RUNNING or FAILED to QUEUED.
        public let state: QueryExecutionState?
        /// Further detail about the status of the query.
        public let stateChangeReason: String?
        /// The date and time that the query was submitted.
        public let submissionDateTime: Date?

        public init(completionDateTime: Date? = nil, state: QueryExecutionState? = nil, stateChangeReason: String? = nil, submissionDateTime: Date? = nil) {
            self.completionDateTime = completionDateTime
            self.state = state
            self.stateChangeReason = stateChangeReason
            self.submissionDateTime = submissionDateTime
        }

        private enum CodingKeys: String, CodingKey {
            case completionDateTime = "CompletionDateTime"
            case state = "State"
            case stateChangeReason = "StateChangeReason"
            case submissionDateTime = "SubmissionDateTime"
        }
    }

    public struct ResultConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// If query results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE-KMS or CSE-KMS) and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings.
        public let encryptionConfiguration: EncryptionConfiguration?
        /// The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
        public let outputLocation: String?

        public init(encryptionConfiguration: EncryptionConfiguration? = nil, outputLocation: String? = nil) {
            self.encryptionConfiguration = encryptionConfiguration
            self.outputLocation = outputLocation
        }

        private enum CodingKeys: String, CodingKey {
            case encryptionConfiguration = "EncryptionConfiguration"
            case outputLocation = "OutputLocation"
        }
    }

    public struct ResultConfigurationUpdates: AWSEncodableShape {
        /// The encryption configuration for the query results.
        public let encryptionConfiguration: EncryptionConfiguration?
        /// The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. For more information, see Query Results If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. The "workgroup settings override" is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
        public let outputLocation: String?
        /// If set to "true", indicates that the previously-specified encryption configuration (also known as the client-side setting) for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the EncryptionConfiguration in ResultConfigurationUpdates (the client-side setting), the EncryptionConfiguration in the workgroup's ResultConfiguration will be updated with the new value. For more information, see Workgroup Settings Override Client-Side Settings.
        public let removeEncryptionConfiguration: Bool?
        /// If set to "true", indicates that the previously-specified query results location (also known as a client-side setting) for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the OutputLocation in ResultConfigurationUpdates (the client-side setting), the OutputLocation in the workgroup's ResultConfiguration will be updated with the new value. For more information, see Workgroup Settings Override Client-Side Settings.
        public let removeOutputLocation: Bool?

        public init(encryptionConfiguration: EncryptionConfiguration? = nil, outputLocation: String? = nil, removeEncryptionConfiguration: Bool? = nil, removeOutputLocation: Bool? = nil) {
            self.encryptionConfiguration = encryptionConfiguration
            self.outputLocation = outputLocation
            self.removeEncryptionConfiguration = removeEncryptionConfiguration
            self.removeOutputLocation = removeOutputLocation
        }

        private enum CodingKeys: String, CodingKey {
            case encryptionConfiguration = "EncryptionConfiguration"
            case outputLocation = "OutputLocation"
            case removeEncryptionConfiguration = "RemoveEncryptionConfiguration"
            case removeOutputLocation = "RemoveOutputLocation"
        }
    }

    public struct ResultSet: AWSDecodableShape {
        /// The metadata that describes the column structure and data types of a table of query results.
        public let resultSetMetadata: ResultSetMetadata?
        /// The rows in the table.
        public let rows: [Row]?

        public init(resultSetMetadata: ResultSetMetadata? = nil, rows: [Row]? = nil) {
            self.resultSetMetadata = resultSetMetadata
            self.rows = rows
        }

        private enum CodingKeys: String, CodingKey {
            case resultSetMetadata = "ResultSetMetadata"
            case rows = "Rows"
        }
    }

    public struct ResultSetMetadata: AWSDecodableShape {
        /// Information about the columns returned in a query result metadata.
        public let columnInfo: [ColumnInfo]?

        public init(columnInfo: [ColumnInfo]? = nil) {
            self.columnInfo = columnInfo
        }

        private enum CodingKeys: String, CodingKey {
            case columnInfo = "ColumnInfo"
        }
    }

    public struct Row: AWSDecodableShape {
        /// The data that populates a row in a query result table.
        public let data: [Datum]?

        public init(data: [Datum]? = nil) {
            self.data = data
        }

        private enum CodingKeys: String, CodingKey {
            case data = "Data"
        }
    }

    public struct StartQueryExecutionInput: AWSEncodableShape {
        /// A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another StartQueryExecution request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the QueryString, an error is returned.  This token is listed as not required because AWS SDKs (for example the AWS SDK for Java) auto-generate the token for users. If you are not using the AWS SDK or the AWS CLI, you must provide this token or the action will fail.
        public let clientRequestToken: String?
        /// The database within which the query executes.
        public let queryExecutionContext: QueryExecutionContext?
        /// The SQL query statements to be executed.
        public let queryString: String
        /// Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
        public let resultConfiguration: ResultConfiguration?
        /// The name of the workgroup in which the query is being started.
        public let workGroup: String?

        public init(clientRequestToken: String? = StartQueryExecutionInput.idempotencyToken(), queryExecutionContext: QueryExecutionContext? = nil, queryString: String, resultConfiguration: ResultConfiguration? = nil, workGroup: String? = nil) {
            self.clientRequestToken = clientRequestToken
            self.queryExecutionContext = queryExecutionContext
            self.queryString = queryString
            self.resultConfiguration = resultConfiguration
            self.workGroup = workGroup
        }

        public func validate(name: String) throws {
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 128)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 32)
            try self.queryExecutionContext?.validate(name: "\(name).queryExecutionContext")
            try self.validate(self.queryString, name: "queryString", parent: name, max: 262_144)
            try self.validate(self.queryString, name: "queryString", parent: name, min: 1)
            try self.validate(self.workGroup, name: "workGroup", parent: name, pattern: "[a-zA-Z0-9._-]{1,128}")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case queryExecutionContext = "QueryExecutionContext"
            case queryString = "QueryString"
            case resultConfiguration = "ResultConfiguration"
            case workGroup = "WorkGroup"
        }
    }

    public struct StartQueryExecutionOutput: AWSDecodableShape {
        /// The unique ID of the query that ran as a result of this request.
        public let queryExecutionId: String?

        public init(queryExecutionId: String? = nil) {
            self.queryExecutionId = queryExecutionId
        }

        private enum CodingKeys: String, CodingKey {
            case queryExecutionId = "QueryExecutionId"
        }
    }

    public struct StopQueryExecutionInput: AWSEncodableShape {
        /// The unique ID of the query execution to stop.
        public let queryExecutionId: String

        public init(queryExecutionId: String = StopQueryExecutionInput.idempotencyToken()) {
            self.queryExecutionId = queryExecutionId
        }

        private enum CodingKeys: String, CodingKey {
            case queryExecutionId = "QueryExecutionId"
        }
    }

    public struct StopQueryExecutionOutput: AWSDecodableShape {
        public init() {}
    }

    public struct TableMetadata: AWSDecodableShape {
        /// A list of the columns in the table.
        public let columns: [Column]?
        /// The time that the table was created.
        public let createTime: Date?
        /// The last time the table was accessed.
        public let lastAccessTime: Date?
        /// The name of the table.
        public let name: String
        /// A set of custom key/value pairs for table properties.
        public let parameters: [String: String]?
        /// A list of the partition keys in the table.
        public let partitionKeys: [Column]?
        /// The type of table. In Athena, only EXTERNAL_TABLE is supported.
        public let tableType: String?

        public init(columns: [Column]? = nil, createTime: Date? = nil, lastAccessTime: Date? = nil, name: String, parameters: [String: String]? = nil, partitionKeys: [Column]? = nil, tableType: String? = nil) {
            self.columns = columns
            self.createTime = createTime
            self.lastAccessTime = lastAccessTime
            self.name = name
            self.parameters = parameters
            self.partitionKeys = partitionKeys
            self.tableType = tableType
        }

        private enum CodingKeys: String, CodingKey {
            case columns = "Columns"
            case createTime = "CreateTime"
            case lastAccessTime = "LastAccessTime"
            case name = "Name"
            case parameters = "Parameters"
            case partitionKeys = "PartitionKeys"
            case tableType = "TableType"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource.
        public let key: String?
        /// A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive.
        public let value: String?

        public init(key: String? = nil, value: String? = nil) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceInput: AWSEncodableShape {
        /// Specifies the ARN of the Athena resource (workgroup or data catalog) to which tags are to be added.
        public let resourceARN: String
        /// A collection of one or more tags, separated by commas, to be added to an Athena workgroup or data catalog resource.
        public let tags: [Tag]

        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceOutput: AWSDecodableShape {
        public init() {}
    }

    public struct UnprocessedNamedQueryId: AWSDecodableShape {
        /// The error code returned when the processing request for the named query failed, if applicable.
        public let errorCode: String?
        /// The error message returned when the processing request for the named query failed, if applicable.
        public let errorMessage: String?
        /// The unique identifier of the named query.
        public let namedQueryId: String?

        public init(errorCode: String? = nil, errorMessage: String? = nil, namedQueryId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.namedQueryId = namedQueryId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case namedQueryId = "NamedQueryId"
        }
    }

    public struct UnprocessedQueryExecutionId: AWSDecodableShape {
        /// The error code returned when the query execution failed to process, if applicable.
        public let errorCode: String?
        /// The error message returned when the query execution failed to process, if applicable.
        public let errorMessage: String?
        /// The unique identifier of the query execution.
        public let queryExecutionId: String?

        public init(errorCode: String? = nil, errorMessage: String? = nil, queryExecutionId: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.queryExecutionId = queryExecutionId
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case queryExecutionId = "QueryExecutionId"
        }
    }

    public struct UntagResourceInput: AWSEncodableShape {
        /// Specifies the ARN of the resource from which tags are to be removed.
        public let resourceARN: String
        /// A comma-separated list of one or more tag keys whose tags are to be removed from the specified resource.
        public let tagKeys: [String]

        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceOutput: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateDataCatalogInput: AWSEncodableShape {
        /// New or modified text that describes the data catalog.
        public let description: String?
        /// The name of the data catalog to update. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.
        public let name: String
        /// Specifies the Lambda function or functions to use for updating the data catalog. This is a mapping whose values depend on the catalog type.    For the HIVE data catalog type, use the following syntax. The metadata-function parameter is required. The sdk-version parameter is optional and defaults to the currently supported version.  metadata-function=lambda_arn, sdk-version=version_number     For the LAMBDA data catalog type, use one of the following sets of required parameters, but not both.   If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.  metadata-function=lambda_arn, record-function=lambda_arn      If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.  function=lambda_arn
        public let parameters: [String: String]?
        /// Specifies the type of data catalog to update. Specify LAMBDA for a federated catalog or HIVE for an external hive metastore.  Do not use the GLUE type. This refers to the AwsDataCatalog that already exists in your account, of which you can have only one. Specifying the GLUE type will result in an INVALID_INPUT error.
        public let type: DataCatalogType

        public init(description: String? = nil, name: String, parameters: [String: String]? = nil, type: DataCatalogType) {
            self.description = description
            self.name = name
            self.parameters = parameters
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.description, name: "description", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
            try self.parameters?.forEach {
                try validate($0.key, name: "parameters.key", parent: name, max: 255)
                try validate($0.key, name: "parameters.key", parent: name, min: 1)
                try validate($0.key, name: "parameters.key", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\t]*")
                try validate($0.value, name: "parameters[\"\($0.key)\"]", parent: name, max: 51200)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case name = "Name"
            case parameters = "Parameters"
            case type = "Type"
        }
    }

    public struct UpdateDataCatalogOutput: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateWorkGroupInput: AWSEncodableShape {
        /// The workgroup configuration that will be updated for the given workgroup.
        public let configurationUpdates: WorkGroupConfigurationUpdates?
        /// The workgroup description.
        public let description: String?
        /// The workgroup state that will be updated for the given workgroup.
        public let state: WorkGroupState?
        /// The specified workgroup that will be updated.
        public let workGroup: String

        public init(configurationUpdates: WorkGroupConfigurationUpdates? = nil, description: String? = nil, state: WorkGroupState? = nil, workGroup: String) {
            self.configurationUpdates = configurationUpdates
            self.description = description
            self.state = state
            self.workGroup = workGroup
        }

        public func validate(name: String) throws {
            try self.configurationUpdates?.validate(name: "\(name).configurationUpdates")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.workGroup, name: "workGroup", parent: name, pattern: "[a-zA-Z0-9._-]{1,128}")
        }

        private enum CodingKeys: String, CodingKey {
            case configurationUpdates = "ConfigurationUpdates"
            case description = "Description"
            case state = "State"
            case workGroup = "WorkGroup"
        }
    }

    public struct UpdateWorkGroupOutput: AWSDecodableShape {
        public init() {}
    }

    public struct WorkGroup: AWSDecodableShape {
        /// The configuration of the workgroup, which includes the location in Amazon S3 where query results are stored, the encryption configuration, if any, used for query results; whether the Amazon CloudWatch Metrics are enabled for the workgroup; whether workgroup settings override client-side settings; and the data usage limits for the amount of data scanned per query or per workgroup. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
        public let configuration: WorkGroupConfiguration?
        /// The date and time the workgroup was created.
        public let creationTime: Date?
        /// The workgroup description.
        public let description: String?
        /// The workgroup name.
        public let name: String
        /// The state of the workgroup: ENABLED or DISABLED.
        public let state: WorkGroupState?

        public init(configuration: WorkGroupConfiguration? = nil, creationTime: Date? = nil, description: String? = nil, name: String, state: WorkGroupState? = nil) {
            self.configuration = configuration
            self.creationTime = creationTime
            self.description = description
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case configuration = "Configuration"
            case creationTime = "CreationTime"
            case description = "Description"
            case name = "Name"
            case state = "State"
        }
    }

    public struct WorkGroupConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.
        public let bytesScannedCutoffPerQuery: Int64?
        /// If set to "true", the settings for the workgroup override client-side settings. If set to "false", client-side settings are used. For more information, see Workgroup Settings Override Client-Side Settings.
        public let enforceWorkGroupConfiguration: Bool?
        /// The engine version that all queries running on the workgroup use. Queries on the AmazonAthenaPreviewFunctionality workgroup run on the preview engine regardless of this setting.
        public let engineVersion: EngineVersion?
        /// Indicates that the Amazon CloudWatch metrics are enabled for the workgroup.
        public let publishCloudWatchMetricsEnabled: Bool?
        /// If set to true, allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to false, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is false. For more information about Requester Pays buckets, see Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide.
        public let requesterPaysEnabled: Bool?
        /// The configuration for the workgroup, which includes the location in Amazon S3 where query results are stored and the encryption option, if any, used for query results. To run the query, you must specify the query results location using one of the ways: either in the workgroup using this setting, or for individual queries (client-side), using ResultConfiguration$OutputLocation. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results.
        public let resultConfiguration: ResultConfiguration?

        public init(bytesScannedCutoffPerQuery: Int64? = nil, enforceWorkGroupConfiguration: Bool? = nil, engineVersion: EngineVersion? = nil, publishCloudWatchMetricsEnabled: Bool? = nil, requesterPaysEnabled: Bool? = nil, resultConfiguration: ResultConfiguration? = nil) {
            self.bytesScannedCutoffPerQuery = bytesScannedCutoffPerQuery
            self.enforceWorkGroupConfiguration = enforceWorkGroupConfiguration
            self.engineVersion = engineVersion
            self.publishCloudWatchMetricsEnabled = publishCloudWatchMetricsEnabled
            self.requesterPaysEnabled = requesterPaysEnabled
            self.resultConfiguration = resultConfiguration
        }

        public func validate(name: String) throws {
            try self.validate(self.bytesScannedCutoffPerQuery, name: "bytesScannedCutoffPerQuery", parent: name, min: 10_000_000)
            try self.engineVersion?.validate(name: "\(name).engineVersion")
        }

        private enum CodingKeys: String, CodingKey {
            case bytesScannedCutoffPerQuery = "BytesScannedCutoffPerQuery"
            case enforceWorkGroupConfiguration = "EnforceWorkGroupConfiguration"
            case engineVersion = "EngineVersion"
            case publishCloudWatchMetricsEnabled = "PublishCloudWatchMetricsEnabled"
            case requesterPaysEnabled = "RequesterPaysEnabled"
            case resultConfiguration = "ResultConfiguration"
        }
    }

    public struct WorkGroupConfigurationUpdates: AWSEncodableShape {
        /// The upper limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.
        public let bytesScannedCutoffPerQuery: Int64?
        /// If set to "true", the settings for the workgroup override client-side settings. If set to "false" client-side settings are used. For more information, see Workgroup Settings Override Client-Side Settings.
        public let enforceWorkGroupConfiguration: Bool?
        /// The engine version requested when a workgroup is updated. After the update, all queries on the workgroup run on the requested engine version. If no value was previously set, the default is Auto. Queries on the AmazonAthenaPreviewFunctionality workgroup run on the preview engine regardless of this setting.
        public let engineVersion: EngineVersion?
        /// Indicates whether this workgroup enables publishing metrics to Amazon CloudWatch.
        public let publishCloudWatchMetricsEnabled: Bool?
        /// Indicates that the data usage control limit per query is removed. WorkGroupConfiguration$BytesScannedCutoffPerQuery
        public let removeBytesScannedCutoffPerQuery: Bool?
        /// If set to true, allows members assigned to a workgroup to specify Amazon S3 Requester Pays buckets in queries. If set to false, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is false. For more information about Requester Pays buckets, see Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide.
        public let requesterPaysEnabled: Bool?
        /// The result configuration information about the queries in this workgroup that will be updated. Includes the updated results location and an updated option for encrypting query results.
        public let resultConfigurationUpdates: ResultConfigurationUpdates?

        public init(bytesScannedCutoffPerQuery: Int64? = nil, enforceWorkGroupConfiguration: Bool? = nil, engineVersion: EngineVersion? = nil, publishCloudWatchMetricsEnabled: Bool? = nil, removeBytesScannedCutoffPerQuery: Bool? = nil, requesterPaysEnabled: Bool? = nil, resultConfigurationUpdates: ResultConfigurationUpdates? = nil) {
            self.bytesScannedCutoffPerQuery = bytesScannedCutoffPerQuery
            self.enforceWorkGroupConfiguration = enforceWorkGroupConfiguration
            self.engineVersion = engineVersion
            self.publishCloudWatchMetricsEnabled = publishCloudWatchMetricsEnabled
            self.removeBytesScannedCutoffPerQuery = removeBytesScannedCutoffPerQuery
            self.requesterPaysEnabled = requesterPaysEnabled
            self.resultConfigurationUpdates = resultConfigurationUpdates
        }

        public func validate(name: String) throws {
            try self.validate(self.bytesScannedCutoffPerQuery, name: "bytesScannedCutoffPerQuery", parent: name, min: 10_000_000)
            try self.engineVersion?.validate(name: "\(name).engineVersion")
        }

        private enum CodingKeys: String, CodingKey {
            case bytesScannedCutoffPerQuery = "BytesScannedCutoffPerQuery"
            case enforceWorkGroupConfiguration = "EnforceWorkGroupConfiguration"
            case engineVersion = "EngineVersion"
            case publishCloudWatchMetricsEnabled = "PublishCloudWatchMetricsEnabled"
            case removeBytesScannedCutoffPerQuery = "RemoveBytesScannedCutoffPerQuery"
            case requesterPaysEnabled = "RequesterPaysEnabled"
            case resultConfigurationUpdates = "ResultConfigurationUpdates"
        }
    }

    public struct WorkGroupSummary: AWSDecodableShape {
        /// The workgroup creation date and time.
        public let creationTime: Date?
        /// The workgroup description.
        public let description: String?
        /// The engine version setting for all queries on the workgroup. Queries on the AmazonAthenaPreviewFunctionality workgroup run on the preview engine regardless of this setting.
        public let engineVersion: EngineVersion?
        /// The name of the workgroup.
        public let name: String?
        /// The state of the workgroup.
        public let state: WorkGroupState?

        public init(creationTime: Date? = nil, description: String? = nil, engineVersion: EngineVersion? = nil, name: String? = nil, state: WorkGroupState? = nil) {
            self.creationTime = creationTime
            self.description = description
            self.engineVersion = engineVersion
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case creationTime = "CreationTime"
            case description = "Description"
            case engineVersion = "EngineVersion"
            case name = "Name"
            case state = "State"
        }
    }
}
